home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.2 for Intel / NeXTSTEP 3.2 for Intel.iso / NextLibrary / Documentation / Sybase / DBLIB / Section2 / dbnumcols.ex < prev    next >
Encoding:
Text File  |  1993-04-22  |  549 b   |  20 lines

  1. int             column_count;
  2. DBPROCESS       *dbproc;
  3.  
  4. /* put the commands into the command buffer */
  5. dbcmd(dbproc, "select name, id, type from sysobjects");
  6. dbcmd(dbproc, " select name from sysobjects");
  7.  
  8. /* send the commands to \*S and start execution */
  9. dbsqlexec(dbproc);
  10.  
  11. /* process each command until there are no more */
  12. while (dbresults(dbproc) != NO_MORE_RESULTS)
  13. {
  14.     column_count = dbnumcols(dbproc);
  15.     printf("%d columns in this \*S result.\\n", 
  16.         column_count);
  17.     while (dbnextrow(dbproc) != NO_MORE_ROWS)
  18.         printf("row received.\\n");
  19. }
  20.